<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\Route;

// 前台首页
Route::get('','index/Index/index');
// 前台登录
Route::post('indexLogin', 'index/login/login');
// 前台个人中心路由
Route::resource('center', 'index/center');

Route::post('center/pic','index/center/pic');
Route::get('center/vip','index/center/vip');

// 容联云
Route::post('reg', 'index/register/yzm');
// 网站主页搜索
Route::get('search', 'index/search/index');
Route::get('ajax', 'index/search/ajax');
// 最新注册
Route::get('latestReg', 'index/search/latestReg');
// 最新登录
Route::get('recentlyLogged', 'index/search/recentlyLogged');
// 登录数据库验证
Route::get('demo', 'index/login/demo');
// 注册
Route::post('register', 'index/register/register');
// 手机号验证
Route::post('tel', 'index/register/tel');

// 退出登录
Route::get('cancellation', 'index/login/cancellation');
// 搜索
Route::get('commit', 'index/search/commit');
// 日记
Route::get('diary', 'index/diary/index');
// 日记显示
Route::get('read', 'index/diary/read');
// 读取日记内容
Route::get('readDiary/:id', 'index/diary/readDiary');
// 提交日记评论
Route::post('comment', 'index/diary/comment');
// 提交日记
Route::post('commitDiary', 'index/diary/diary');


// 后台用户管理资源路由
Route::resource('user', 'admin/user');
Route::get('userImg/:id','admin/userImg/index');
Route::resource('gift', 'admin/gift');

Route::resource('order', 'admin/order');


Route::post('user/pic','admin/user/pic');
Route::post('user/status','admin/user/status');

Route::get('admin', 'admin/index/index');
Route::get('login', 'admin/login/login');
Route::get('req', 'admin/login/req');
Route::post('dologin', 'admin/login/dologin');
Route::post('gift/pic', 'admin/gift/pic');
Route::post('gift/ban', 'admin/gift/ban');
Route::get('gift/trash', 'admin/gift/trash');
Route::post('gift/del', 'admin/gift/del');
Route::post('gift/reset', 'admin/gift/reset');
Route::get('mail/:id','index/mail/index');



// 站内信路由
// 聊天主页
Route::get('message/:id','index/message/index');
// 发送消息
Route::post('message/send','index/message/update');
// 标记全部未读消息为已读
Route::post('message/readchange','index/message/readchange');
// 查询该用户的全部聊天记录
Route::post('message/find','index/message/find');
// 查询是否有未读消息
Route::post('message/refresh/:id','index/message/refresh');
// 标记单个未读消息为已读
Route::post('message/mark','index/message/mark');


return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];